<link rel="stylesheet" type="text/css" href="css/news.css"/>
<div id="global">
<!-- Begin Left -->
<div id="left">
		<h1 class="title-news">TƯ VẤN LUẬT NHÀ ĐẤT</h1>&nbsp;&nbsp;&nbsp;&nbsp;
		<div class="line-red line-news"></div>
		<div class="list-news">
        	<?php
				$acategory = acategory::model()->find(array(
					"condition" => "alias = 'tu-van-luat-nha-dat' "
				));
				
				$article_array = article::model()->findAll(array(
					"condition" => "acategory_id = " . $acategory->id
				));
				
				foreach($article_array as $article)
				{
					$link = Yii::app()->baseUrl."/tin-tuc/". $article->alias;
					echo "<div class='news'>";
					echo "<h4>";
						echo CHtml::link($article->subject, $link);
					echo "</h4>";
					//echo "<img src='img/04.jpg'/>";
					echo $article->image;
					echo "<div class='sumary'>";
						echo $article->summary;
					echo "</div>";
					echo "<strong><a href='$link'>Xem chi tiết</a></strong>";
					echo "</div>";
				}
			?>
			
		</div>
		
    <h1 class="title-news">TIN BẤT ĐỘNG SẢN</h1>&nbsp;&nbsp;&nbsp;
		<div class="line-red line-news"></div>
		<div class="list-news">
			<?php
				$acategory = acategory::model()->find(array(
					"condition" => "alias = 'tin-tuc-bat-dong-san'"
				));
				
				$article_array = article::model()->findAll(array(
					"condition" => "acategory_id = " . $acategory->id
				));
				
				foreach($article_array as $article)
				{
					$link = Yii::app()->baseUrl."/tin-tuc/". $article->alias;
					echo "<div class='news'>";
					echo "<h4>";
						echo CHtml::link($article->subject, $link);
					echo "</h4>";
					echo $article->image;
					echo "<div class='sumary'>";
						echo $article->summary;
					echo "</div>";
					echo "<strong><a href='$link'>Xem chi tiết</a></strong>";
					echo "</div>";
				}
			?>	
		</div>	
		
<h1 class="title-news">PHONG THỦY-KIẾN TRÚC</h1>
		<div class="line-red line-news"></div>
		<div class="list-news">
			<?php
				$acategory = acategory::model()->find(array(
					"condition" => "alias = 'phong-thuy-kien-truc'"
				));
				
				$article_array = article::model()->findAll(array(
					"condition" => "acategory_id = " . $acategory->id
				));
				
				foreach($article_array as $article)
				{
					$link = Yii::app()->baseUrl."/tin-tuc/". $article->alias;
					echo "<div class='news'>";
					echo "<h4>";
						echo CHtml::link($article->subject, $link);
					echo "</h4>";
					//echo "<img src='img/04.jpg'/>";
					echo $article->image;
					echo "<div class='sumary'>";
						echo $article->summary;
					echo "</div>";
					echo "<strong><a href='$link'>Xem chi tiết</a></strong>";
					echo "</div>";
				}
			?>	
		
								
		</div>					
</div>
<!-- End left -->

<!-- Begin right -->
<div id="right">
	<div class="right-product">
	<h4>CHO THUÊ <span>TỐT NHẤT</span></h4>
	<div class="r-view-all"><a href="#">Tất cả</a></div>
	<div class="line-red"></div>
		<?php
			$product_array = product::model()->findAll(array(
				"condition" => "enable =1 ",
				"limit" => 9
			));
			
			foreach($product_array as $product)
			{
				//Each Right Product
				echo "<div class='right-listproduct'>";
					//echo "<img class='right-img-p' src='img/p-right.gif'/>";
					echo $product->image;
					echo "<div class='p-area'><span>";
						echo $product->dien_tich . "m²";
					echo "</span></div>";
					echo "<div class='p-room'><span>";
					echo $product->so_phong . " Phòng";
					echo "</span></div>";
					echo "<div class='p-month'><span>";
						echo $product->price;
					echo "</span></div>";
				echo "</div>";
				 "</div>";
                echo CHtml::link(
						 	$product->name,
							Yii::app()->baseUrl."/bat-dong-san/". 
							$product->id."-".MyHelper::clear_sign($product->name)
						);			
				echo "<div class='r-line'></div>";
				//Each Right Product
			}
		?>
	</div>
</div>
<!-- End right -->
</div>